package com.edward.puff.config;

import com.edward.puff.repository.TransLogRepository;
import lombok.Data;
import lombok.experimental.Accessors;

import java.lang.reflect.Method;
import java.util.List;

/**
 * @Author: Edward
 * @Date: 2019/11/27 下午4:43
 * <p>
 * puff元数据
 */
@Accessors(chain = true)
@Data
public class PuffMetadata {

    private Class<?> clazz;

    private Method method;

    private String signature;

    private int txIdIndex;

    private Class<? extends TransLogRepository> repositoryClass;

    private String dateSourceName;

    private String executorBeanName;

    private List<ArgsTypeIndex> argsTypeIndexes;


    @Data
    public static class ArgsTypeIndex {

        private Class<?> argClass;

        private int argIndex;

        public ArgsTypeIndex(Class<?> argClass, int argIndex) {
            this.argClass = argClass;
            this.argIndex = argIndex;
        }
    }
}
